package root.electronclass.electronclass.mvp.entity;

import root.electronclass.electronclass.grade.model.MediaVo;

import java.util.List;

public class HomeNoticeInfoHH implements IHomeNoticeInfoH{
    private String content;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    private String startTime;

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    private List<MediaVo> picList;

    public List<MediaVo> getPicList() {
        return picList;
    }

    public void setPicList(List<MediaVo> picList) {
        this.picList = picList;
    }

    private int readFlag;

    public int getReadFlag() {
        return readFlag;
    }

    public void setReadFlag(int readFlag) {
        this.readFlag = readFlag;
    }

    private String title;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    private int level;

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    private String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String getIdH() {
        return getId();
    }

    @Override
    public String getTitleH() {
        return getTitle();
    }

    @Override
    public String getDateH() {
        return getStartTime();
    }

    @Override
    public String getNoticeUrl() {
        if (getPicList() != null && getPicList().size() > 0) {
            return getPicList().get(0).getUrl();
        }
        return null;
    }

    @Override
    public int getLevelH() {
        return getLevel();
    }

    @Override
    public int getStatusH() {
        if (getReadFlag() - 1 < 0) {
            return 0;
        } else {
            return getReadFlag() - 1;
        }
    }

    @Override
    public String getNoticeIdH() {
        return getIdH();
    }

    @Override
    public void setStatusH(int status) {
        setReadFlag(status + 1);
    }
}
